#define BUFFERSIZE      1024 
#define NAMESIZE        18       

struct chat_message {
   int type;
   char data[BUFFERSIZE - sizeof(int)];
};

#define REGISTER        1
#define UNREGISTER      2
#define MESSAGE         3
#define NAMELIST        4
#define ERROR           5